package com.customization.unionpay.contract.workflowaction;

import com.customization.unionpay.contract.serivce.IVirtualContractService;
import com.customization.unionpay.contract.serivce.impl.VirtualContractServiceImpl;
import com.engine.common.util.ServiceUtil;
import weaver.general.BaseBean;
import weaver.interfaces.workflow.action.Action;
import weaver.soa.workflow.request.RequestInfo;
import weaver.workflow.request.RequestManager;

public class VirtualContractLedgerAction extends BaseBean implements Action {

    private IVirtualContractService getVirtualContractService() {
        return ServiceUtil.getService(VirtualContractServiceImpl.class);
    }

    @Override
    public String execute(RequestInfo requestInfo) {
        RequestManager manager =requestInfo.getRequestManager();
        int formId = manager.getFormid();
        int requestId = manager.getRequestid();
        try {
            getVirtualContractService().contractLedger(formId,requestId);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return SUCCESS;
    }
}
